#include "2-bit_tree.hpp"

template<class T = int>
BitTree<T>* createBitTree()
{
  typedef BitNode<T> Node;
  Node* head = new Node(12);
  head->lchild = new Node(9);
  head->lchild->parent = head;
  head->rchild = new Node(13);
  head->rchild->parent = head;
  head->lchild->lchild = new Node(8);
  head->lchild->lchild->parent = head->lchild;
  head->lchild->rchild = new Node(11);
  head->lchild->rchild->parent = head->lchild;
  head->rchild->lchild = new Node(12);
  head->rchild->lchild->parent = head->rchild;
  head->rchild->rchild = new Node(20);
  head->rchild->rchild->parent = head->rchild;
  return new BitTree<T>(head);
}

template<class T = int>
void testBaseBitTree(BitTree<T>* tree)
{
  tree->preOrder(); std::cout << std::endl;
  tree->inOrder(); std::cout << std::endl;
  tree->postOrder(); std::cout << std::endl;

  tree->levelOrder(); std::cout << std::endl;
}

int main (int argc, char* argv[])
{
  auto tree = createBitTree();
  // testBaseBitTree(tree);
  tree->print();
  return 0;
}

